/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fr.cggveritas.crewintranet.jms.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Alassane
 */
@Entity
@Table(name = "cv_evaluationvehicule")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CvEvaluationvehicule.findAll", query = "SELECT c FROM CvEvaluationvehicule c"),
    @NamedQuery(name = "CvEvaluationvehicule.findByIdevaluationvehicule", query = "SELECT c FROM CvEvaluationvehicule c WHERE c.idevaluationvehicule = :idevaluationvehicule"),
    @NamedQuery(name = "CvEvaluationvehicule.findByDate", query = "SELECT c FROM CvEvaluationvehicule c WHERE c.date = :date"),
    @NamedQuery(name = "CvEvaluationvehicule.findByTypeevaluation", query = "SELECT c FROM CvEvaluationvehicule c WHERE c.typeevaluation = :typeevaluation"),
    @NamedQuery(name = "CvEvaluationvehicule.findByDerniereevaluation", query = "SELECT c FROM CvEvaluationvehicule c WHERE c.derniereevaluation = :derniereevaluation"),
    @NamedQuery(name = "CvEvaluationvehicule.findByScanevaluation", query = "SELECT c FROM CvEvaluationvehicule c WHERE c.scanevaluation = :scanevaluation"),
    @NamedQuery(name = "CvEvaluationvehicule.findByDurevaliditejour", query = "SELECT c FROM CvEvaluationvehicule c WHERE c.durevaliditejour = :durevaliditejour")})
public class CvEvaluationvehicule implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "idevaluationvehicule")
    private Integer idevaluationvehicule;
    @Basic(optional = false)
    @Column(name = "date")
    @Temporal(TemporalType.DATE)
    private Date date;
    @Column(name = "typeevaluation")
    private String typeevaluation;
    @Lob
    @Column(name = "commentaire")
    private String commentaire;
    @Column(name = "derniereevaluation")
    private String derniereevaluation;
    @Column(name = "scanevaluation")
    private String scanevaluation;
    @Column(name = "durevaliditejour")
    private Integer durevaliditejour;
    @JoinColumn(name = "cv_typeevaluationvehicule_idtypeevaluation", referencedColumnName = "idtypeevaluation")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private CvTypeevaluationvehicule cvTypeevaluationvehiculeIdtypeevaluation;
    @JoinColumn(name = "cv_vehicule_idvehicule", referencedColumnName = "idvehicule")
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private CvVehicule cvVehiculeIdvehicule;

    public CvEvaluationvehicule() {
    }

    public CvEvaluationvehicule(Integer idevaluationvehicule) {
        this.idevaluationvehicule = idevaluationvehicule;
    }

    public CvEvaluationvehicule(Integer idevaluationvehicule, Date date) {
        this.idevaluationvehicule = idevaluationvehicule;
        this.date = date;
    }

    public Integer getIdevaluationvehicule() {
        return idevaluationvehicule;
    }

    public void setIdevaluationvehicule(Integer idevaluationvehicule) {
        this.idevaluationvehicule = idevaluationvehicule;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public String getTypeevaluation() {
        return typeevaluation;
    }

    public void setTypeevaluation(String typeevaluation) {
        this.typeevaluation = typeevaluation;
    }

    public String getCommentaire() {
        return commentaire;
    }

    public void setCommentaire(String commentaire) {
        this.commentaire = commentaire;
    }

    public String getDerniereevaluation() {
        return derniereevaluation;
    }

    public void setDerniereevaluation(String derniereevaluation) {
        this.derniereevaluation = derniereevaluation;
    }

    public String getScanevaluation() {
        return scanevaluation;
    }

    public void setScanevaluation(String scanevaluation) {
        this.scanevaluation = scanevaluation;
    }

    public Integer getDurevaliditejour() {
        return durevaliditejour;
    }

    public void setDurevaliditejour(Integer durevaliditejour) {
        this.durevaliditejour = durevaliditejour;
    }

    public CvTypeevaluationvehicule getCvTypeevaluationvehiculeIdtypeevaluation() {
        return cvTypeevaluationvehiculeIdtypeevaluation;
    }

    public void setCvTypeevaluationvehiculeIdtypeevaluation(CvTypeevaluationvehicule cvTypeevaluationvehiculeIdtypeevaluation) {
        this.cvTypeevaluationvehiculeIdtypeevaluation = cvTypeevaluationvehiculeIdtypeevaluation;
    }

    public CvVehicule getCvVehiculeIdvehicule() {
        return cvVehiculeIdvehicule;
    }

    public void setCvVehiculeIdvehicule(CvVehicule cvVehiculeIdvehicule) {
        this.cvVehiculeIdvehicule = cvVehiculeIdvehicule;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idevaluationvehicule != null ? idevaluationvehicule.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CvEvaluationvehicule)) {
            return false;
        }
        CvEvaluationvehicule other = (CvEvaluationvehicule) object;
        if ((this.idevaluationvehicule == null && other.idevaluationvehicule != null) || (this.idevaluationvehicule != null && !this.idevaluationvehicule.equals(other.idevaluationvehicule))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "fr.cggveritas.crewintranet.jms.entities.CvEvaluationvehicule[ idevaluationvehicule=" + idevaluationvehicule + " ]";
    }
    
}
